#ifndef __GAME_MGR_H__
#define __GAME_MGR_H__

#include "utils/singleton.h"
#include "./pages/playermodepage.h"
#include "./pages/enemymodepage.h"
#include "./pages/mainpage.h"

typedef void (Delegater::*OnGameReadyFunc)();
typedef void (Delegater::*OnGameExitFunc)();

class GameMgr : public Singleton<GameMgr>
{
	enum PageEnum
	{
		PageEnum_MainPage,
		PageEnum_PlayerModePage,
		PageEnum_EnemyModePage
	};
public:
	GameMgr();
	~GameMgr();

public:
	void StartGame(HDC hDC);
	void StopGame();
	void SetWinSize(Size cx);

	Size GetWinSize();
	Size GetStageSize();
	float GetStageDepth();

private:
	void OnRenderStart();
	void ChangeToPage(PageEnum page);

	//MainPage Event
	void OnPlayerModeClick();
	void OnEnemyModeClick();
	void OnExitClick();

	//ModePage Event
	void OnBackToMenuClick();

public:
	Event<OnGameReadyFunc> OnReady;
	Event<OnGameExitFunc> OnExit;

	PlayerModePage* m_pPlayerModePage;
	EnemyModePage* m_pEnemyModePage;
	MainPage* m_pMainPage;

	Size m_winSize;
};

#endif